home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 September / CHIP Eylül 1998.iso / Slackwar / docs / mini / Loadlin+Win95 < prev    next >
Text File  |  1997-03-17  |  23KB  |  514 lines

  1.   The Loadlin+Win95 mini-HOWTO
  2.   Authored by: Chris Fischer,protek@brigdoon.com
  3.   v1.4.0, 6 March 1998
  4.  
  5.   This document describes how to use Loadlin with Win95 to boot to
  6.   Linux.
  7.  
  8.   1.  Introduction
  9.  
  10.   This document describes how to easily use a combination of Windows
  11.   95's Boot Menu and Loadlin.exe to autoboot Linux using the F4 Function
  12.   Key. This procedure should work with Windows 95 versions 4.00.950 and
  13.   4.00.950a, and all versions of Linux that support Loadlin. If you
  14.   prefer to use the LILO boot manager, please consult theLinux+Win95
  15.   Mini-HOWTO.
  16.  
  17.   1.1.  Copyright
  18.  
  19.   The Loadlin+Win95 mini-HOWTO is copyright (C) 1997- 1998 by Protek
  20.   Computer Solutions. This document may be reproduced and distributed in
  21.   whole or in part, in any medium physical or electronic, as long as
  22.   this copyright notice is retained on all copies. Commercial
  23.   redistribution is allowed and encouraged; however, the author would
  24.   like to be notified of any such distributions.
  25.  
  26.   1.2.  New Versions Of This Document
  27.  
  28.   This mini-HOWTO is posted first at The Linux+Windows 95  Reference
  29.   Page, so check there to make sure you have the most recent revision of
  30.   this mini-HOWTO.
  31.  
  32.   1.3.  Feedback
  33.  
  34.   Questions, comments, and suggestions are welcome. I am always looking
  35.   for ways to improve and expand this mini-HOWTO. I rely heavily on
  36.   feedback to make improvements, and will do my best to be prompt with a
  37.   helpful response. I can be reached at protek@brigadoon.com.
  38.  
  39.   1.4.  Disclaimer
  40.  
  41.   Every attempt has been made to ensure that the information presented
  42.   in this mini-HOWTO is safe and accurate. However, this information is
  43.   given without any warranty, either expressed or implied, as to its
  44.   suitability for a particular use. It is generally considered a
  45.   GoodThing(TM) to make backups of your system files before changing
  46.   system configurations and/or files. I suggest you take this precaution
  47.   "just in case".
  48.  
  49.   2.  IMPORTANT: Preliminary Information and Setup
  50.  
  51.   2.1.  WARNING! for Windows95 OSR2 (version 4.00.950b) users:
  52.  
  53.   Do NOT attempt dual booting with Windows 95 without first consulting
  54.   the Windows 95 OSR2 FAQ. The FAQ also contains a great deal of
  55.   information regarding FAT32. In a nutshell, if you have OSR2 and are
  56.   using a FAT16 file system, you can still dual boot using the F4
  57.   Function Key.
  58.  
  59.   NOTE: If you have Windows 95 OSR2, and are using a FAT32 file system,
  60.   then the dual booting methods in this  mini-HOWTO will not work and
  61.   should not be  attempted.
  62.  
  63.   However, there are a couple of alternate methods you can use  to
  64.   automate booting Linux at startup, which are discussed in ``''.
  65.  
  66.   2.2.  Things that are assumed:
  67.  
  68.   ╖  You have successfully installed Windows 95.
  69.  
  70.   ╖  Wndows 95 is installed on Drive C.
  71.  
  72.   ╖  You have successfully installed Linux.
  73.  
  74.   ╖  You know what partition Linux is installed on.
  75.  
  76.   ╖  LILO is NOT installed on your hard drive.
  77.  
  78.   ╖  If you are using Windows 95 OSR2 (version 4.00.950b), you have
  79.      carefully read the Windows95 OSR2 FAQ.
  80.  
  81.   2.3.  Items you need before you start:
  82.  
  83.   ╖  A bootable floppy disk with DOS 5.0 or DOS 6.x system files
  84.      (io.sys, msdos.sys, command.com) and a config.sys file. If you are
  85.      using a DOS 5.0 boot disk, you will also need an autoexec.bat file.
  86.      If you are using Windows 95 OSR2 (version 4.00.950b), you will also
  87.      need to create a file called Winboot.sys with a text editor and
  88.      place it in the root directory of Drive C.  Winboot.sys can be an
  89.      empty file, just  so long as you have the file.
  90.  
  91.   NOTE: If your hard drive already contains the autoexec.dos,
  92.   config.dos, io.dos, msdos.dos, and command.dos files, then you will
  93.   not need the floppy. You can check by typing: dir and dir /ah at the
  94.   root of Drive C.  Also, if you installed the Upgrade version of
  95.   Windows 95, then it is likely that you have them.
  96.  
  97.   ╖  The Loadlin.exe program file
  98.  
  99.   ╖  Your kernel image file,usually zImage or vmlinuz. (See the ``'' for
  100.      info).
  101.  
  102.   ╖  A simple text editor, such as Notepad.
  103.  
  104.   3.  Getting started:
  105.  
  106.   3.1.  Determine what version of Windows 95 you have.
  107.  
  108.   Boot your computer to Windows 95 and right click on the My omputer
  109.   icon. Now left click on Properties. On the eneral tab, look under the
  110.  
  111.   3.2.  Determine if you are using the FAT32 file system.
  112.  
  113.   NOTE: If you have Windows 95 version 4.00.950b, make certain you are
  114.   not using the FAT32 file system. Double click the My Computer  icon,
  115.   then right click the Drive C icon. Left click on Properties. On the
  116.   General tab, the 'Type:' line will indicate whether or not you have a
  117.   FAT32 file system. If you are using the FAT32 file system, then go
  118.   directly to ``'' . Otherwise, continue with  Section 3.3.
  119.  
  120.   3.3.  Make sure filename extensions are visible in Windows Explorer.
  121.  
  122.   ╖  Run the Windows Explorer file manager program.
  123.  
  124.   ╖  On the Menu Bar, click on View, then click on Options.  On the View
  125.      Tab, make sure that the 'Show all files ' radio button is marked.
  126.      Also, make sure that the line with 'Hide MS-DOS file extensions for
  127.      file types that are registered ' is unchecked.  Click on the OK
  128.      button.
  129.  
  130.   NOTE: If your hard drive already contains the *.dos files mentioned in
  131.   the ``'', then skip to the next ``''.  Otherwise,  continue with
  132.   Section 3.4.
  133.  
  134.   3.4.  Rename your system files.
  135.  
  136.   ╖  Insert the DOS 5.0 or DOS 6.x bootable floppy into Drive A. Click
  137.      on the Drive A icon so you can see the contents on the floppy disk.
  138.  
  139.   ╖  Rename each file to a .dos file extension. You can do this by
  140.      single clicking on a file, pressing the F2 function key, and typing
  141.      in the new name. Do not worry if you need the bootable floppy to
  142.      work properly, just rename the files back after you are finished
  143.      with this procedure.
  144.  
  145.   3.5.  Important Warning.
  146.  
  147.   ╖  EXTREMELY IMPORTANT: Make sure you rename the files on the floppy
  148.      BEFORE you copy them to Drive C. Otherwise you will overwrite your
  149.      Windows 95 system files. You have been warned.  Now, copy all files
  150.      to the root directory of Drive C. One method is to click on the
  151.      Drive A icon, press CTRL+A, press CTRL+C, click on the Drive C
  152.      icon, and press CTRL+V.
  153.  
  154.   NOTE: If you do not have Windows 95 OSR2 (version 4.00.950b), please
  155.   skip to ``''.
  156.  
  157.   ╖  If (and only if) you have Windows95 version 4.00.950b, make sure
  158.      you have a file named Winboot.sys in the root directory of Drive C,
  159.      as stated in ``'' above. Failure to have Winboot.sys in the root
  160.      directory of Drive C will result in a system lockup should you
  161.      attempt to boot to an earlier version of DOS.
  162.  
  163.   NOTE: If you are using a  DOS 6.x boot disk skip to ``'', otherwise
  164.   continue with the next step.
  165.  
  166.   3.6.  Edit your system files.
  167.  
  168.   ╖  Open Notepad. On the Menu Bar, click on Open. Change 'Files of
  169.      type' to 'All files (*.*)'. Change 'Look in:' from Desktop to Drive
  170.      C. Now open Config.dos by double clicking on the filename. Delete
  171.      all the contents. This will create a 0K file...I will explain
  172.      later. Save the file.
  173.  
  174.   ╖  Use Notepad to open and edit Autoexec.dos and type in the Loadlin
  175.      command. The Loadlin command must be in the following syntax:
  176.  
  177.        ______________________________________________________________________
  178.                Loadlin DriveLetter:\LinuxKernelFile root=/dev/LinuxBootPartition ro
  179.        ______________________________________________________________________
  180.  
  181.   Here is my Autoexec.dos file as an example:
  182.  
  183.        ______________________________________________________________________
  184.                Loadlin f:\vmlinuz root=/dev/hdc2 ro
  185.        ______________________________________________________________________
  186.  
  187.   NOTE: The kernel, as well as the Loadlin.exe, file may be anywhere on
  188.   your hard drive as long as you reference the correct path. For
  189.   example, if your kernel file was located in  the directory e:uxrnels
  190.   and Loadlin.exe was located in the directory c:tils, you would use:
  191.  
  192.        ______________________________________________________________________
  193.                c:\utils\loadlin e:\linux\kernels\vmlinuz root=/dev/hdc2 ro
  194.        ______________________________________________________________________
  195.  
  196.   ╖  Save the file.
  197.  
  198.   4.  *** Use this section ONLY if you are using a DOS 6.x boot disk.
  199.   ***
  200.  
  201.   4.1.  Edit and Rename your DOS 6.x system files.
  202.  
  203.   ╖  Open Notepad. On the Menu Bar, click on Open. Change 'Files of
  204.      type' to 'All files (*.*)'. Change 'Look in:' from Desktop to Drive
  205.      C. Now open Config.dos by double clicking on the filename. Delete
  206.      all the contents. Now, you will need to enter the shell command
  207.      with the following syntax:
  208.  
  209.        ______________________________________________________________________
  210.                shell=loadlin.exe LinuxKernelFile root=/dev/LinuxBootPartition ro
  211.        ______________________________________________________________________
  212.  
  213.   Here is my Config.dos file as an example:
  214.  
  215.        ______________________________________________________________________
  216.                shell=f:\loadlin.exe f:\vmlinuz root=/dev/hdc2 ro
  217.        ______________________________________________________________________
  218.  
  219.   NOTE: The loadlin and kernel file may be  anywhere on your hard drive
  220.   as long as you reference the correct path. For example, if your
  221.   loadlin file was in the directory f:tils and the kernel file was
  222.   located in the directory e:uxrnels you would use:
  223.  
  224.        ______________________________________________________________________
  225.                shell=f:\utils\loadlin.exe e:\linux\kernels\vmlinuz root=/dev/hdc2 ro
  226.        ______________________________________________________________________
  227.  
  228.   ╖  Save the file.
  229.  
  230.   5.  Final Steps
  231.  
  232.   5.1.  Almost Finished
  233.  
  234.   ╖  One last file to edit and then you are finished. Use Notepad to
  235.      open and edit Msdos.sys. Goto the "Options" section. Look for a
  236.      line that has BootMulti=. If you do not find one then add it and
  237.      set the value to 1. It should look something like:
  238.  
  239.        ______________________________________________________________________
  240.                [Options]
  241.                BootMulti=1
  242.        ______________________________________________________________________
  243.  
  244.   ╖  There may be other items listed. Just leave them. Now save the
  245.      file.
  246.  
  247.   5.2.  You are finished!
  248.  
  249.   Now all you have to do is reboot (Don't forget to remove the floppy
  250.   disk). When you see 'Starting Windows 95...', press the F4 Function
  251.   Key and Linux should boot right up.
  252.  
  253.   5.3.  How it works.
  254.  
  255.   Windows 95 has a built in Boot Menu. By default you do not see it at
  256.   startup (although you can change that if you wish), but you can get to
  257.   it by pressing the F8 Function Key when you see 'Starting Windows
  258.   95...'. On the menu you will see several options. The last option is
  259.   'Previous version of  MS-DOS'. Instead of pressing F8 and then
  260.   selecting 'Previous version of MS-DOS', you can use the F4 shortcut by
  261.   pressing F4 when 'Starting Windows 95...'  appears on the screen. When
  262.   Windows 95 boots to the previous  version of MS-DOS, it uses the files
  263.   that end in the .dos file extension. This is why it is important to
  264.   have a 0K Config.dos file if you are initiating Linux from the
  265.   Autoexec.dos file. If Windows 95 does not find the files with a .dos
  266.   extension while trying to boot the previous operating system, it will
  267.   load the Windows 95 startup files.  Therefore, if you do not have a
  268.   Config.dos file, Windows 95 will load all the drivers in your
  269.   Config.sys file. While this will not prevent Linux from loading, it
  270.   will take longer. Having a 0K Config.dos file prevents Windows 5 from
  271.   reading your Config.sys file while booting to the previous version of
  272.   MS-DOS.
  273.  
  274.   6.  FAT32 File System: Alternate Methods for Auto-Booting Linux, Espe¡
  275.   cially for Users With a
  276.  
  277.   This section will work for all versions of Windows 95 to date,
  278.   regardless of whether you have a FAT32 file system. There are two
  279.   methods I will discuss in this section. First, I'll start with  the
  280.   simplest.
  281.  
  282.   6.1.  Method 1.
  283.  
  284.   This method uses the Autoexec.bat file to call (or execute) another
  285.   batch file named Linux.bat, during boot up.
  286.  
  287.   ╖  Creat a Linux.bat file using a simple text editor such as EDIT or
  288.      Notepad. The contents should be similar to the following:
  289.  
  290.        ______________________________________________________________________
  291.                @echo off
  292.                cls
  293.                echo.
  294.                echo.
  295.                echo.
  296.                echo.
  297.                choice /t:y,5 'Do you wish to boot Linux? '
  298.                if errorlevel 2 goto End
  299.                c:\loadlin c:\vmlinuz root=/dev/hdc2 ro
  300.                :End
  301.        ______________________________________________________________________
  302.  
  303.   This batch file script clears the screen, adds four blank lines,
  304.   displays the text in quotes + Y,N, then waits 5 seconds for you to
  305.   press a key. If you do not press a key within 5 seconds, it defaults
  306.   to Y and runs Linux. If you select Y or N, the batch file determines
  307.   what option you selected, then executes the selected option.  For
  308.   example, if you select 'N' then the batch file terminates and
  309.   continues to process your Autoexec.bat file, which loads Windows 95.
  310.   If you select Y, then of course Linux will load.
  311.   If you do not want four blank lines before the text, modify the number
  312.   of lines with echo. If you do not want the screen to clear, then
  313.   remove the line with cls. The /t switch tells the choice command to
  314.   wait 5 seconds and, if no key is pressed, to default to Y. Change the
  315.   y to an n if you want Windows 95 to boot after the 5 second timeout:
  316.   choice /t:n,5.  Also, you can change the amount of time to wait from 0
  317.   to 99 seconds.  For more information on the choice command, change to
  318.   the c:312rectory and type: choice /? at the command prompt.
  319.  
  320.   NOTE: You will have to modify the line that boots Linux to match your
  321.   configuration. Please see ``'' for examples of how to configure
  322.   Loadlin to boot to Linux.
  323.  
  324.   ╖  Next, create an Autoexec.bat file (if you don't already have one)
  325.      with a simple text editor. Then, on the first line, add the
  326.      following:
  327.  
  328.        ______________________________________________________________________
  329.                call c:\linux
  330.        ______________________________________________________________________
  331.                                                                     t
  332.                                                                     c
  333.                                                                     h
  334.                                                                     ,
  335.                                                                     y
  336.   If Linux.bat is in another directory you will have to reference theo
  337.   correct path. For example if Linux.bat is in a directory called C:udd:
  338.                                                                     w
  339.                                                                     o
  340.                                                                     u
  341.        _____________________________________________________________l_________
  342.                call c:\batch\linux                                  d
  343.        ______________________________________________________________________
  344.  
  345.   to the first line of your Autoexec.bat file. Save and exit the file.
  346.   Now all you need to do is reboot. You should be prompted on whether
  347.   you want to boot Linux.
  348.  
  349.   6.2.  Method 2.
  350.  
  351.   This method is a bit more involved, but offers the greatest
  352.   flexibility. What this method does it create your own custom boot
  353.   menu, though it does not replace the Windows 95 boot menu. You will
  354.   need a Config.sys and an Autoexec.bat file.
  355.  
  356.   ╖  First you will need to define a Startup Menu in Config.sys (my
  357.      comments to you are in parenthesis):
  358.  
  359.   ______________________________________________________________________
  360.           [menu]
  361.           menuitem=Linux, Boot to Linux  (This defines a Menu Block and gives it
  362.           a description).
  363.           menuitem=Win95, Boot to Windows 95
  364.           menucolor=15,1  (This gives a blue background with bright white text)
  365.           menudefault=Linux, 15  (This sets the default menuitem and waits up to
  366.           15 seconds for input).
  367.  
  368.           [linux]
  369.           shell=f:\loadlin.exe f:\vmlinuz root=/dev/hdc2 ro (Please see Section 4
  370.           for examples and syntax).
  371.           [win95]
  372.           (Include the normal contents of your config.sys file here. If you did
  373.           not have a config.sys file before now, then leave this section blank).
  374.  
  375.   ______________________________________________________________________
  376.  
  377.   ╖  Save and exit your Config.sys file. If you want, you can use this
  378.      Config.sys template to get started.
  379.  
  380.   ╖  Next, edit your Autoexec.bat file (my comments to you are in
  381.      parenthesis):
  382.  
  383.        ______________________________________________________________________
  384.                goto %config%
  385.  
  386.                :win95
  387.                (Include the normal contents of your autoexec.bat file here. If you did
  388.                not have an autoexec.bat file before now, then leave this section
  389.                blank).
  390.        ______________________________________________________________________
  391.  
  392.   ╖  Save and exit your Autoexec.bat file. If you want, you can use this
  393.      Autoexec.bat template to get started. That should do it. The next
  394.      time you reboot, you should get a Start Up menu with the option to
  395.      boot to Linux or Windows 95.
  396.  
  397.   7.  Frequently Asked Questions:
  398.  
  399.   7.1.  Where can I find more information on using Loadlin?
  400.  
  401.   ╖  Slackware 3.2 contains a file named loadlin.tgz in the
  402.      ckware0ckware0file named manual.txt. I do not know about earlier
  403.      versions of Slackware.
  404.  
  405.   ╖  RedHat 4.2 and 5.0 contains a file named loadlin16.tgz in the
  406.      osutils directory. Unarchive the file and look in the ocs directory
  407.      for a file named manual.txt. RedHat 4.1 does not seem to have this
  408.      archive. The manual.txt is also available for download at:
  409.        ftp://ftp.eskimo.com/u/p/praxis/manual.txt
  410.  
  411.   ╖  Additional information is available at:
  412.  
  413.        http://sunsite.unc.edu/LDP/HOWTO/BootPrompt-HOWTO-2.html#ss2.2
  414.  
  415.   7.2.  I am not sure what partition Linux is installed on. How do I
  416.   find out?
  417.  
  418.   ╖  At a Linux shell prompt, run the fdisk utility and press "p". From
  419.      there you should be able to tell. If you need additional help using
  420.      fdisk, please consult the man pages.
  421.  
  422.   7.3.  Where do I find the kernel image file and how do I copy it to my
  423.   MS-DOS partition?
  424.  
  425.   ╖  To find your linux kernel file type:
  426.  
  427.        ______________________________________________________________________
  428.                find / -name vmlinuz
  429.        ______________________________________________________________________
  430.  
  431.   at a Linux shell prompt. This will search all Linux partitions for the
  432.   vmlinuz file. If you have multiple vmlinuz files, then make sure you
  433.   use the correct one. If you are not sure, then the safest bet would be
  434.   to use the most recent one.
  435.  
  436.   To copy your linux kernel file to your DOS partition, you need to make
  437.   your DOS partition visible to Linux, then mount the partition if it is
  438.   not already. Generally, this should have been set up when you
  439.   installed Linux. All you need to do next is change to the directory
  440.   the vmlinuz file is in and copy it over to DOS using the cp command.
  441.  
  442.   However, if Linux was not set up to recognize your DOS partition, then
  443.   copy vmlinuz to a floppy. Take any DOS formatted floppy (with enough
  444.   disk space to hold your kernel image file) and insert it into your
  445.   floppy drive. Type:
  446.  
  447.        ______________________________________________________________________
  448.                mount /dev/fd0 /tmp
  449.        ______________________________________________________________________
  450.  
  451.   at a Linux shell prompt. Then change to the directory your kernel
  452.   image file is in and type:
  453.  
  454.        ______________________________________________________________________
  455.                cp vmlinuz /tmp
  456.        ______________________________________________________________________
  457.  
  458.   This will copy vmlinuz to your floppy disk and it will be readable by
  459.   DOS. Shutdown Linux, boot to DOS, then copy vmlinuz to whichever
  460.   directory you choose. If you recompile your kernel, do not forget to
  461.   copy the new kernel image file to your DOS partition. This will
  462.   overwrite your old file, so it might be a good idea to rename the old
  463.   file first just in case the new one does not work properly.
  464.  
  465.   7.4.  Does it matter if I install Linux or Windows 95 first?
  466.  
  467.   ╖  Technically no. However, it would be much simpler to install Win95
  468.      first. That way it is easier to setup Linux to recognize your DOS
  469.      partition(s) as you can usually do this during the Linux
  470.      installation.
  471.  
  472.   7.5.  want to boot to Linux using this method?  What if I already dual
  473.   boot between Windows 95 and Windows 3.x, and I
  474.  
  475.   ╖  Frankly, if you want to do this I would recommend using LILO.
  476.      However, if you really do not want to use LILO, you will have to
  477.      boot to Win 3.x first, then issue the Loadlin command. (Make sure
  478.      Windows 3.x is NOT running, but that you are in DOS 5.0 or 6.x).
  479.  
  480.   7.6.  Is it possible to initiate Linux from the Windows 95 desktop?
  481.  
  482.   ╖  Yes. First, create a batch file called linux.bat, for example.
  483.      Edit the file to contain a Loadlin command such as:
  484.  
  485.        ______________________________________________________________________
  486.                loadlin f:\vmlinuz root=/dev/hdc2 ro
  487.        ______________________________________________________________________
  488.  
  489.   Now save the file in the 312rectory. Next, right click on the
  490.   Linux.bat icon, then left click on Properties. Now click on the Pro¡
  491.   gram tab, then click on the Advanced button. Click on the box next to
  492.   MS-DOS mode and make sure the box next to "Warn before entering MS-DOS
  493.   mode is checked". Click OK, then click on OK again. Now when you dou¡
  494.   ble click on the Linux icon, a warning box will appear before going
  495.   into MS-DOS mode. If you click on "Yes" then Windows enters MS-DOS
  496.   mode and executes the Linux.bat file.
  497.  
  498.   NOTE: You must be in MS-DOS mode in order to use Loadlin. Please see
  499.   the manual.txt file mentioned in ``'' of this ``'' for more
  500.   information.
  501.  
  502.   7.7.  Where can I get a plain text version of this document?
  503.  
  504.   ╖  You can get a plain text version of this document at:
  505.  
  506.        ftp://ftp.eskimo.com/u/p/praxis/loadlin.txt
  507.  
  508.   8.  Credits
  509.  
  510.   A special thanks toNorm Jacobowitz and Fred Harris for helping me sort
  511.   out the Windows 95 OSR2 issues and for helping me improve this mini-
  512.   HOWTO.
  513.  
  514.